<template>
  <div class="detail-wrap">
    <el-dialog v-model="dialogVisible" :title="title" width="800px" class="one-dialog" draggable @close="emit('close')">
      <el-form ref="ruleFormRef" :model="ruleForm">
        <el-row>
          <el-col :span='8'>
            <el-form-item label="拉取单号：">{{props.currentRow.code}}</el-form-item>
          </el-col>
          <el-col :span='8'>
            <el-form-item label="申请人：">{{props.currentRow.applyUser}}</el-form-item>
          </el-col>
          <el-col :span='8'>
            <el-form-item label="申请时间：">{{props.currentRow.time}}</el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <el-table :data="tableData" size="small">
        <el-table-column type="index" label="序号" align="center" width="80" />
        <el-table-column label="能力编码" prop="code" />
        <el-table-column label="能力名称" prop="name" />
        <el-table-column label="提供单位" prop="orgName" />
        <el-table-column label="交付方式" prop="orgName" />
        <el-table-column label="能力版本号" prop="version" />
        <el-table-column label="操作" width="100">
          <template #default="scope">
            <a :style="{color: '#409eff'}" :href="'http://10.12.6.88/demo/ability/' + scope.row.id" target="_blank">详情</a>
            <!-- <el-button link type="primary" size="small" @click="handleShow">详情</el-button> -->
          </template>
        </el-table-column>
      </el-table>
      <el-form-item label="申请用途：">{{props.currentRow.use}}</el-form-item>
      <Details v-if="isDialogs" :currentRow="currentRow" :type="type" @close="isDialogs = false" />
    </el-dialog>
    
  </div>
</template>
<script lang="ts" setup>
import to from 'await-to-js'
import type { FormInstance } from 'element-plus'
import Details from './details.vue'
const currentRow = ref<any>()
const emit = defineEmits(['close'])
const props = defineProps<{
  currentRow: any
  type: string
}>()
const isDialogs = ref(false)
const handleShow = (row?: UserInfo) => {
  currentRow.value = row
  isDialogs.value = true
}
const title = ref('拉取详情')
const dialogVisible = ref<boolean>(true)
const ruleForm = ref({
  orgName: '重庆',
  code: '012436456499',
  time: '2020-09-01 13:44:21',
  applyUser: '张三',
  status: 0
})
const tableData = ref(props.currentRow.inner)
</script>
<style lang="scss" scoped>
.detail-wrap {
}
</style>
